﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.YG
{
    /// <summary>
    /// 阳光人寿阳光财富两全保险
    /// </summary>
    class Class11
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period > 0)
            {
                da.Value = ppa.Amount * 0.1;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period >0 && (ppa.Period+1) % 10==0)
            {
                da.Value = ppa.Amount * 0.18;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Age==75)
            {
                da.Value = ppa.TotalFee;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("水路交通意外身故"))
            {
                ppa.SchemePeriodActing.InsurantStates.Add("身故");

                if (ppa.Age >= 18 && ppa.Age < 60)
                {

                    if (ppa.TotalFee * 3 > ppa.Amount + 3000000)
                    {
                        da.Value = ppa.TotalFee + 3000000;
                        da.Description = "累计已交保费加3百万";
                    }
                    else
                    {
                        da.Value = ppa.TotalFee *3;
                        da.Description = "累计已交保费乘以3";
                    }

                }
                else
                {
                    da.Value = ppa.TotalFee;
                    da.Description = "累计已交保费";
                }

                ppa.IsCurrentFinish = true;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("航空意外身故"))
            {
                ppa.SchemePeriodActing.InsurantStates.Add("身故");

                if (ppa.Age >= 18 && ppa.Age < 60)
                {

                    if (ppa.TotalFee * 3 > ppa.Amount + 5000000)
                    {
                        da.Value = ppa.TotalFee + 5000000;
                        da.Description = "累计已交保费加5百万";
                    }
                    else
                    {
                        da.Value = ppa.TotalFee * 3;
                        da.Description = "累计已交保费乘以5";
                    }

                }
                else
                {
                    da.Value = ppa.TotalFee;
                    da.Description = "累计已交保费";
                }

                ppa.IsCurrentFinish = true;
            }
        }
    }
}
